<template>
  <div class="shop-list-container">
    <el-table :data="shopData" border style="width: 100%">
      <el-table-column prop="shopName" label="店铺名称" />
      <el-table-column prop="shopCode" label="店铺编码" />
      <el-table-column prop="products" label="参与商品数(件)" />
      <el-table-column prop="persons" label="访客数(人)" />
      <el-table-column prop="orders" label="订单数(笔)" />
      <el-table-column prop="customers" label="成交客户数(笔)" />
      <el-table-column prop="price" label="客单价(元)" />
      <el-table-column prop="total" label="成交总额(元)" />
    </el-table>
    
    <div class="pagination-container">
      <el-pagination
        :current-page="currentPage"
        :page-sizes="[10, 20, 50, 100]"
        :page-size="pageSize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="total"
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
      />
    </div>
  </div>
</template>

<script>
export default {
  name: 'ShopList',
  props: {
    shopData: {
      type: Array,
      default: () => []
    },
    total: {
      type: Number,
      default: 0
    },
    currentPage: {
      type: Number,
      default: 1
    },
    pageSize: {
      type: Number,
      default: 10
    }
  },
  methods: {
    handleSizeChange(val) {
      this.$emit('size-change', val);
    },
    handleCurrentChange(val) {
      this.$emit('current-change', val);
    }
  }
}
</script>

<style scoped>
.shop-list-container {
  margin-top: 20px;
}

.pagination-container {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
}
</style>